package kotlin05.src.main.java.com.example.kotlin05.s03;

import java.util.*;

/**
 * 95.1 zip 合并函数java代码示例
 *
 * 合并集合成map集合，然后给予合成样式
 *
 */
public class ZipTestJava {

    public static void main(String[] args) {
        List<String> employees = Arrays.asList("jack", "jason", "tommy");
        List<String> shirtSizes = Arrays.asList("large", "x-large", "medium");


        Map<String,String> employeeShirtsize = new HashMap<>();
        for (int i = 0; i < employees.size(); i++) {
            employeeShirtsize.put(employees.get(i),shirtSizes.get(i));
        }

        //增加集合样式
        List<String>  formattedList = new ArrayList<>();
        for (Map.Entry<String,String> entry : employeeShirtsize.entrySet()){
            formattedList.add(String.format("%s- shirt size: %s",entry.getKey(),entry.getValue()));
        }


        System.out.println(formattedList);

    }



}
